using System.Diagnostics;
using System.IO;
using VSSDKAssist.Assets.Actions.Base;
using VSSDKAssist.Assets.Actions.General;
using VSSDKAssist.Recipes.Common.Helpers;

namespace VSSDKAssist.Recipes.LaunchVSOnExpHive
{
	/// <summary>
	/// Action that Launches VS on Exp hive
	/// </summary>
	public class LaunchVSOnExpHiveAction : ActionBase
	{
		/// <summary>
		/// Called when [execute].
		/// </summary>
		protected override void OnExecute()
		{
			using(ExecuteProcessAction executeProcessAction = new ExecuteProcessAction())
			{
				executeProcessAction.Site = this.Site;
				executeProcessAction.FileName =
					Path.Combine(CommonHelper.GetVSInstallPath(), Constants.DevEnv);

				executeProcessAction.Arguments = @"/rootSuffix Exp";
				executeProcessAction.CreateWindow = true;
				executeProcessAction.WindowStyle = ProcessWindowStyle.Maximized;
				executeProcessAction.WaitForExit = false;
				executeProcessAction.Execute();
			}
		}
	}
}